<!DOCTYPE html>
<html dir="ltr" lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
    <title>Stencil Component Starter</title>

    <script type="module" src="/build/ibz-calendar.esm.js"></script>
    <script nomodule src="/build/ibz-components.js"></script>
    <style>
        html,
        body,
        div {
            margin: 0px;
        }

        html,
        body {
            overflow: hidden;
        }

        body {
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        body .ibiz-calendar {
            height: 70vh;
            width: 60vw;
        }
    </style>
</head>

<body>

    <ibz-calendar option="{}" cus-name="名字" id='ibz-calendar'></ibz-calendar>
    <script>
        var el = document.getElementById('ibz-calendar');
        el.addEventListener('data-change', (e) => {
            console.log('数据变更', e.detail);
        });
        el.addEventListener('item-click', (e) => {
            console.log('数据点击', e.detail);
        });
        el.addEventListener('new-item', (e) => {
            console.log('数据新建', e.detail);
        });
        el.addEventListener('did-load', (e) => {
            el.option = {
                allowTimeOverlap: true,
                timeSplitScale: 60,
                dragOffsetMinutes: 15,
                spanDay: 10,
                startDate: '2020-05-08',
                timeDeviation: 180
            };
            el.items = [
                { text: '烤鱼吃', startTime: '2020-05-09 8:00:00', endTime: '2020-05-10 13:00:00' },
                { text: '俊俊请客', startTime: '2020-05-09 15:00:00', endTime: '2020-05-09 16:00:00' },
                { text: '王象请客', startTime: '2020-05-10 15:00:00', endTime: '2020-05-10 16:00:00' },
                { text: '造飞机', startTime: '2020-05-11 6:00:00', endTime: '2020-05-12 10:00:00' },
                { text: '造地铁', startTime: '2020-05-12 9:00:00', endTime: '2020-05-12 10:00:00' },
                { text: '造轮船', startTime: '2020-05-12 11:00:00', endTime: '2020-05-12 18:00:00' },
                { text: '修电脑', startTime: '2020-05-12 13:00:00', endTime: '2020-05-12 14:00:00' },
                { text: '去相亲', startTime: '2020-05-12 15:00:00', endTime: '2020-05-12 17:00:00' },
                { text: '去相亲2', startTime: '2020-05-12 15:00:00', endTime: '2020-05-12 17:00:00' },
                { text: '去相亲3', startTime: '2020-05-12 16:00:00', endTime: '2020-05-12 18:00:00' },
                { text: '放飞自我', startTime: '2020-05-12 6:00:00', endTime: '2020-05-12 8:00:00' },
                { text: '跑步', startTime: '2020-05-12 16:00:00', endTime: '2020-05-12 18:00:00' },
                { text: '自习室', startTime: '2020-05-12 9:00:00', endTime: '2020-05-12 12:00:00' },
                { text: '自习室2', startTime: '2020-05-12 18:00:00', endTime: '2020-05-12 19:00:00' },
                { text: '自习室3', startTime: '2020-05-12 19:00:00', endTime: '2020-05-12 20:00:00' }
            ];
        });
    </script>
</body>

</html>